package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.PolicyQaMapper;
import com.jieshuibao.model.db.PolicyQa;
import com.jieshuibao.model.db.PolicyQaExample;

@Service
public class PolicyQaService{
	
	@Resource
	private PolicyQaMapper policyQaMapper;
	
	public void addPolicyQa(PolicyQa policyQa) {
		policyQaMapper.insertSelective(policyQa);
	}
	
	public void delPolicyQaByUuid(String uuid) {
		policyQaMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updatePolicyQa(PolicyQa policyQa) {
		policyQaMapper.updateByPrimaryKeySelective(policyQa);
	}
	
	public PolicyQa getPolicyQaByUuid(String uuid) {
		return policyQaMapper.selectByPrimaryKey(uuid);
	}
	
	public List<PolicyQa> getPagePolicyQa(PolicyQaExample policyQaExample) {
		return policyQaMapper.selectPage(policyQaExample);
	}
	
	public List<PolicyQa> getPolicyQas(PolicyQaExample policyQaExample) {
		return policyQaMapper.selectByExample(policyQaExample);
	}
	
	public int countPolicyQa(PolicyQaExample policyQaExample) {
		return policyQaMapper.countByExample(policyQaExample);
	}
}
